﻿using DAL;
using IService;
using Model;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Service
{
    public class OmSalesOrderService : IOmSalesOrderService
    {
        private readonly OmSalesOrderDal dal;
        public OmSalesOrderService(OmSalesOrderDal dal)
        {
            this.dal = dal;
        }

        public Task<int> AuditorStatus(string status, long id)
        {
            return dal.AuditorStatus(status, id);
        }
        public Task<int> Status(string status, long id)
        {
            return dal.Status(status, id);
        }
        public Task<int> CreateAsync(OmSalesOrder data)
        {
            return dal.CreateAsync(data);
        }

        public Task<int> DeleteAsync(long Id)
        {
            return dal.DeleteAsync(Id);
        }

        public Task<List<OmSalesOrder>> GetAllAsync()
        {
            return dal.GetAllAsync();
        }

        public Task<List<SalesOrderDTO>> GetAllWithDetailsAsync()
        {
            return dal.GetAllWithDetailsAsync();
        }

        public Task<List<SalesOrderDTO>> GetAllWithDetailsIdAsync(long id)
        {
            return dal.GetAllWithDetailsIdAsync(id);

        }
        public Task<List<WhInventory>> GetInventoryByGoodsCode(string goodsCode)
        {
            return dal.GetInventoryByGoodsCode(goodsCode);
        }
        public Task<OmSalesOrder> GetByIdAsync(long Id)
        {
            return dal.GetByIdAsync(Id);
        }

        public Task<List<WhInventory>> GetInventoryId(string code)
        {
            return dal.GetInventoryId(code);
        }

        public Task<UserOrgInfo> GetUsersId(long id)
        {
            return dal.GetUsersId(id);
        }

        public Task<int> UpdateAsync(OmSalesOrder date)
        {
            return dal.UpdateAsync(date);
        }

        public Task<int> UpdateAuditorComment(Auditor date)
        {
            return dal.UpdateAuditorComment(date);
        }

        public Task<List<SalesOrderDTO>> GetAllWithDetailsIdAsync(string id)
        {
            return dal.GetAllWithDetailsIdAsync(id);
        }
    }
}
